/*
 * @Author: your name
 * @Date: 2019-11-01 10:18:37
 * @LastEditTime: 2019-11-01 15:27:34
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \koa-example\src\routes\public.js
 */
const router = require('koa-router')();
const { publicNegativePara } = require('../../controllers/public/publicNegativeParaService.js');

module.exports = (app) => {
    /**router.post()配置post路由 */
    router.get('/api/public/negativePara',  async (ctx, next)=>{
        let result = await publicNegativePara(ctx.request.body)
        console.log(result)
        if(result) {
            ctx.body =  {
                success: true,
                data: result
            }
        }else {
            ctx.body =  {
                success: false,
                err_code: 0000001,
                err_msg: "获取毒鸡汤失败"
            }
        }
        
    })
    
    app.use(router.routes()).use(router.allowedMethods());
}